<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/templateNotAlerta.xhtml">

<ui:define name="body">
	
	<h2 class="title"><a href="#">Consultar Gráficos</a></h2><br/>
	
    <h:form id="racaForm">

	        <h:panelGrid columns="1">
	        	<s:decorate template="/layout/edit.xhtml">
	        		<ui:define name="label">Período:</ui:define>
	        		<rich:calendar value="#{biController.dataInicio}"
	        			enableManualInput="true"
	        			oninputkeydown="Mascara(this,Data)"
	        			oninputkeyup="Mascara(this,Data)"
	        			datePattern="dd/MM/yyyy"
	        			required="true"/>
	        		à
	        		<rich:calendar value="#{biController.dataFim}"
	        			enableManualInput="true"
	        			oninputkeydown="Mascara(this,Data)"
	        			oninputkeyup="Mascara(this,Data)"
	        			datePattern="dd/MM/yyyy"
	        			required="true"/>
	        	</s:decorate>
	        </h:panelGrid>
	        
	        <div class="actionButtons">
	            <h:commandButton id="gerar" value="Gerar" action="#{biController.gerarGraficos()}"
	            	onclick="#{rich:component('carregando')}.show()"/>
	        </div>
	        
	        <center>
	        	<h1>GRÁFICOS</h1>
	        
		        <h:panelGrid columns="1" style="align:center;"
		        	rendered="#{biController.exibirGraficos}">
		        	<s:graphicImage value="#{biController.graficoTendenciaMeses}"/>
		        	<s:graphicImage value="#{biController.graficoTendenciaMesesVlrBruto}"/>
		        	<s:graphicImage value="#{biController.graficoDiasSemanaPedido}"/>
		        	<s:graphicImage value="#{biController.graficoServicosMaisPedidos}"/>
		        	<s:graphicImage value="#{biController.graficoMelhoresClientes}"/>
		        	<s:graphicImage value="#{biController.graficoMelhoresClientesValor}"/>
		        	<s:graphicImage value="#{biController.graficoProdutosMaisVendidos}"/>
		        	<s:graphicImage value="#{biController.graficoFormasPagamento}"/>
		        	<s:graphicImage value="#{biController.graficoDiasSemanaMedia}"/>
		        </h:panelGrid>
	        </center>
	        
	        <br/>
	        
	        <div align="center">
	        	<h:commandLink target="blank" action="#{biController.imprimir()}"
		        	rendered="#{biController.exibirGraficos}">
		        	<h:commandButton value="IMPRIMIR" />
		        </h:commandLink>
	        </div>
    </h:form>

 </ui:define>
</ui:composition>
